import {
  IfSong
} from '../../network/http'
Component({
  /**
   * 组件的属性列表
   */

  properties: {
    SongTitle: {
      type: String,
      value: '青花瓷'
    },
    SongSinger: {
      type: String,
      value: '周杰伦-七里香'
    },
    SongId: {
      type: [String, Number],
      value: 1
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },
  lifetimes: {
    attached: function () {

    },
  },
  /**
   * 组件的方法列表
   */
  methods: {
    async playLink(e) {
     
      const {
        data: res
      } = await IfSong(e.target.dataset.id)
      console.log(res);
      if (!res.success) return wx.showToast({
         title: res.message,
         icon:"error",
         duration: 2000
        })
      wx.navigateTo({
        url: `/pages/play/play?id=${e.target.dataset.id}`,
      })
    },

  }
})